package com.ht.modules.authentication.config;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
@Configuration
public class AuthWebFilterConfig implements WebMvcConfigurer {
    @Override
    public void addInterceptors(InterceptorRegistry interceptorRegistry) {
        InterceptorRegistration interceptorRegistration = interceptorRegistry.addInterceptor(new AuthInterceptor());
        //拦截路径
        interceptorRegistration.addPathPatterns("/cas/api/**");
        //添加不拦截路径
        interceptorRegistration.excludePathPatterns(
                "/cas/api/**/getToken/**"
        );
    }
}
